package com.study.eurekaclienthystrix.feign;

import com.study.eurekaclienthystrix.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * 在 feign 的基础上使用 hystrix, fallback 指定发生异常时处理类
 *
 * @author huang
 */
@FeignClient(value = "eureka-client-test", fallback = EurekaClientTestFallback.class)
public interface EurekaClientTestFeign {

    @GetMapping("/testClient/get")
    String get();

    @PostMapping("/testClient/post/{gender}")
    String post(@PathVariable String gender, @RequestBody User user);
}
